package com.sphd.beautysalon.adapters;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.sphd.beautysalon.R;
import com.sphd.beautysalon.info.MoneyRecordInfo;
import com.sphd.beautysalon.utils.Constant;
import com.wzh.frame.utils.BigDisMailUtils;
import com.wzh.frame.utils.TimeUtils;

import java.util.List;

/**
 * Created by Hu on 2017/1/3.
 */

public class MoneyRecordAdapter extends BaseQuickAdapter<MoneyRecordInfo> {
    public MoneyRecordAdapter(int layoutResId, List<MoneyRecordInfo> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder baseViewHolder, MoneyRecordInfo moneyRecordInfo) {

        baseViewHolder
                .setText(R.id.i_type,moneyRecordInfo.getApply_type()==1?"投资":"撤资")
                .setText(R.id.i_money,moneyRecordInfo.getApply_type()==1?"+"+
                        BigDisMailUtils.turnTrim(moneyRecordInfo.getRatify_money(), Constant.DECIMAL_POINT)
                        :"-"
                        + BigDisMailUtils.turnTrim(moneyRecordInfo.getRatify_money(), Constant.DECIMAL_POINT))
                .setText(R.id.i_time, TimeUtils.formatString(TimeUtils.DATE_FORMAT_DATE,moneyRecordInfo.getRatify_regtime()));
    }
}
